package com.ruoyi.report.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;

/**
 * Lag Time Report 数据表，存储 Walmart 平台商品的履约延迟时间信息
 * @TableName walmart_lag_time_report
 */
@TableName(value ="walmart_lag_time_report")
@Data
public class WalmartLagTimeReport implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)  // 设置主键和主键策略
    private Long id;
    /**
     * 商品的 SKU（库存单位）
     */
    @TableField(value = "sku")
    private String sku;

    /**
     * 商品的全球贸易项目编码（GTIN）
     */
    @TableField(value = "gtin")
    private String gtin;

    /**
     * 商品名称
     */
    @TableField(value = "product_name")
    private String productName;

    /**
     * 商品类别
     */
    @TableField(value = "category")
    private String category;

    /**
     * 履约延迟时间（以天为单位）
     */
    @TableField(value = "fulfillment_lag_time")
    private String fulfillmentLagTime;

    /**
     * 唯一请求id
     */
    @TableField(value = "request_id")
    private String requestId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        WalmartLagTimeReport other = (WalmartLagTimeReport) that;
        return (this.getSku() == null ? other.getSku() == null : this.getSku().equals(other.getSku()))
            && (this.getGtin() == null ? other.getGtin() == null : this.getGtin().equals(other.getGtin()))
            && (this.getProductName() == null ? other.getProductName() == null : this.getProductName().equals(other.getProductName()))
            && (this.getCategory() == null ? other.getCategory() == null : this.getCategory().equals(other.getCategory()))
            && (this.getFulfillmentLagTime() == null ? other.getFulfillmentLagTime() == null : this.getFulfillmentLagTime().equals(other.getFulfillmentLagTime()))
            && (this.getRequestId() == null ? other.getRequestId() == null : this.getRequestId().equals(other.getRequestId()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getSku() == null) ? 0 : getSku().hashCode());
        result = prime * result + ((getGtin() == null) ? 0 : getGtin().hashCode());
        result = prime * result + ((getProductName() == null) ? 0 : getProductName().hashCode());
        result = prime * result + ((getCategory() == null) ? 0 : getCategory().hashCode());
        result = prime * result + ((getFulfillmentLagTime() == null) ? 0 : getFulfillmentLagTime().hashCode());
        result = prime * result + ((getRequestId() == null) ? 0 : getRequestId().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", sku=").append(sku);
        sb.append(", gtin=").append(gtin);
        sb.append(", productName=").append(productName);
        sb.append(", category=").append(category);
        sb.append(", fulfillmentLagTime=").append(fulfillmentLagTime);
        sb.append(", requestId=").append(requestId);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}